<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>赋值运算符=</title>
</head>
<body>
<script>
    /*   1.=等于号就是赋值运算符
    *     可以将符号右侧的值赋值给符号左侧的变量
    *    2.+=
    *       a=a+5等价于a+=5
    *     3.-=
    *        a=a-5等价于a-=5
    *     4.*=
    *        a=a*5 等价于a*=5
    *     5./=
    *         a=a/5等价于a/=5
    *      6.%=
    *          a=a%5等价于a%=5
    * */
    //1.+=举例1
    var a=20;
        //a=a+5;//相当于a+=5;
        a+=5;
    console.log("a="+a);
    //2.-=举例1
    var b=20;
    //b=b-5;//相当于b-=5;
    b-=5;
    console.log("b="+b);
    //3.*=举例1
    var c=20;
    //c=c*5;//相当于c*=5;
    c*=5;
    console.log("c="+c);
    //4./=举例1
    var d=20;
    //d=d/5;//相当于d/=5;
    d/=5;
    console.log("d="+d);
    //5.%=举例1  取余数
    var e=19;
    //e=e%5;//相当于e%=5;
    e%=5;
    console.log("e="+e);
</script>
</body>
</html>